package com.yanqu.road.server.cmd.marriage.crossworld;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.marriage.CrossMarriageProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.marriage.CrossUnionWorldMarriageMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_WORLD_MARRIAGE_APPLY_AGREE, desc = "同意跨服联姻(只有同意)")
public class CrossWorldMarriageAgreeCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        CrossMarriageProto.CrossMarriageAgreeCrossDealReqMsg reqMsg = CrossMarriageProto.CrossMarriageAgreeCrossDealReqMsg.parseFrom(packet.getBytes());
        String partnerChildUid = reqMsg.getPartnerChildUid();
        CrossUnionWorldMarriageMgr.agreeMarriage(serverId, packet.getPlayerId(), partnerChildUid, reqMsg.getApplyData());
    }

    @Override
    public void sendData() {

    }
}
